//
//  GameScene.h
//  CandyJump
//
//  Created by Bon Lam on 26/02/2011.
//  Copyright 2011 Peru Republic. All rights reserved.
//

#import "cocos2d.h"
#import "chipmunk.h"

#import "StageManager.h"

@class Character;
@class PhysicsManager;
@class GameDataManager;
@class SkillManager;
@class GameLayer;
@class GameUILayer;

//=====================================================================================================================
@interface GameScene : CCLayer
{
	
}

@property (readonly) GameLayer* gameLayer;
@property (readonly) GameUILayer* UILayer;

+(GameScene*) sharedLayer;
+(id) scene;

@end

//=====================================================================================================================
@interface GameUILayer : CCLayer
{
	CCProgressTimer* skillButtonOne;
	int skillOne;
	bool skillOneCD;
	int skillOneCDTime;

	CCProgressTimer* skillButtonTwo;
	int skillTwo;
	bool skillTwoCD;
	int skillTwoCDTime;
}

@end

//=====================================================================================================================
@interface GameLayer : CCLayer <StageManagerDelegate>
{
	//	MapObjects
	Character *character;
	
	//	Physics
	cpSpace *space;
	
	//	Game Play
	int currentheight;		//	Indicating the height(of the bottom screen) of the physics space
	
	
	//	Managers
	StageManager* stageManager;
	PhysicsManager* physicsManager;
	GameDataManager* gameDataManager;
	SkillManager* skillManager;
}

//---------------------------------------------------------------------------------------------------------------------
#pragma mark -
#pragma mark Object Functions
- (id)init;
- (void)dealloc;

#pragma mark Custom Functions
- (void)step: (ccTime) dt;

- (void)resetGame;
- (void)castSkill:(int) skill;

#pragma mark System Delegates
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration;

#pragma mark CCStandardTouchDelegate
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;

#pragma mark StageManager Delegates
- (Character*)character;
- (int)currentheight;
- (void)addStageObject:(Model*)model;
- (void)removeStageObject:(Model*)model;
- (void)removeAllStageObjects;

@end